<template>
    <div>
        <div> {{ a }}</div>
        <div>
            <ul>
                <li v-for="item in list" :key="item.id">
                    {{ item }}
                </li>
            </ul>
        </div>
        <button @click="sendToy(toy)">我需要给父亲传递参数</button>
    </div>
</template>
<script setup lang="ts">
import { defineProps, withDefaults, ref } from 'vue'
// defineOptions({ name: 'OddRule' })
let propsData = defineProps(['a','list','sendToy'])

// let propsData: any = defineProps({
//     a: { type: String, default: '0' },
//     list: { type: Array, default: [] }
// });

let toy = ref("奥特曼")

// withDefaults用于限制类型

console.log("我父元素传递", propsData)



</script>
<style lang="scss" scoped></style>